<!--
 * @Author: luoqi
 * @Date: 2022-04-30 22:04:42
 * @LastEditors: luoqi
 * @LastEditTime: 2022-05-03 18:32:13
 * @Description: 
-->
<template>
  <!-- 收藏历史记录 -->
  <el-row class="Ctogether">
    <el-col :span="24">
      <p>粉丝列表</p>
      <el-row>
        <el-col :span="24">
          <el-row
            class="gugug"
            v-for="(item, index) in historyData"
            :key="index"
          >
            <el-col :span="18">
              <el-row>
                <el-col :span="3" >
                  <router-link :to="{path:'/main/herhome/myall',query:{id:item.id}}">
                  <el-avatar
                    size="large"
                    :src="item.headImg"
                  ></el-avatar>
                  </router-link>
                </el-col>
                <el-col :span="19" class="fans-title">
                  <div>{{ item.nickname }}<span>&nbsp;{{ item.age && item.age + "岁" }}</span
                >&nbsp;<span>{{ item.occupation }}</span></div>
                  <div>
                    <h5>{{item.personalizedSignature}}</h5>
                  </div>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="6" class="dates">
              <el-tag
                style="color: #aaa; fontweight: bold"
                effect="plain"
              >
                <i class="el-icon-check"></i> 已关注你</el-tag
              >
            </el-col>
          </el-row>
        </el-col>
      </el-row>
    </el-col>
  </el-row>
</template>

<script>
export default {
  props: ["collection",'id'],
  data() {
    return {
      //收藏历史记录数据
      historyData: [],
    };
  },
  watch: {
    
  },
  methods:{
   getData(id){
     this.$axios({
        method: "post",
        url: "/user/getFans",
        data: this.$qs.stringify({
          userId:id
        }),
      }).then((res) => {
        console.log(res);
        if (res.code != "200") {
          this.$message.error(res.msg);
        } else {
          this.historyData = res.data;
        }
      });
   }
  },
  created() {
    if (this.$route.path == "/main/MyHome/myfans") {
      this.getData(this.$getStorage('userinfo').id)
      
    } else {
      this.getData(this.$store.state.herData.data.id)
    }
  },
};
</script>

<style lang="less" scoped>
@import url("../../less/myhome.less");
.fans-title{
  font-size: 18px;
  font-weight: bold;
  span{
    font-size: 12px !important;
    color: #aaa;
    display: inline-block;
    margin-left: 10px;
    font-weight: 400;
  }
  h5{
    font-weight: 400;
  }
}
.gugug{
  padding: 10px 0;
  border-bottom: 1px #e6e6e6 solid;
}
</style>